﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="province.aspx.cs" Inherits="js_province" %>
<%@ OutputCache Location="Any" Duration="60" VaryByParam="none" %>
<!--
<%=js() %>
provinceOp = new provinceList();
cityOp = new cityList();

function delCity(city)
{
	var len = city.length;
	for(i=0; i<len; i++)
	{
		city.remove(0);
	}
}

function addCity(prov, city)
{
	var index = prov.selectedIndex;
	//alert(cityOp[index].length);	
	for(j=0; j<cityOp[index].length; j++)
	{
		city.options.add(cityOp[index][j]);
	}
}

function changeProvince(proObj, cityObj)
{
	delCity(cityObj);
	addCity(proObj,cityObj);
	//alert("省份：" + proObj.value + "\t城市：" + cityObj.value);
}

function initialize(proObj, cityObj, provinceID, cityID)
{
	// 初始化省份列表
	for(i=0; i<provinceOp.length; i++)
	{
		proObj.options.add(provinceOp[i]);
	}
	for(j=0; j<proObj.options.length; j++)
	{
		if(proObj.options[j].value == provinceID)
		{
			proObj.options[j].selected = true;
		}
	}
	addCity(proObj, cityObj);
	for(k=0; k<cityObj.options.length; k++)
	{
	    
	    //alert(cityObj.options[k].value == cityID);
		if(cityObj.options[k].value == cityID)
		{
			cityObj.options[k].selected = true;
		}
	}
}

//-->